//
//  LoginExpireView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/4/17.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "LoginExpireView.h"
#import <Masonry.h>

@implementation LoginExpireView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    self.imv = [[UIImageView alloc] init];
    self.imv.image = [UIImage imageNamed:@"icon_warning"];
    CGFloat offset = self.frame.size.height * 0.3;
    [self addSubview:self.imv];
    [self.imv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(offset);
        make.width.mas_equalTo(72);
        make.height.mas_equalTo(72);
    }];
    
    self.tipsLab = [[UILabel alloc] init];
    self.tipsLab.text = @"登录已失效";
    self.tipsLab.textColor = ETColorWithRGB(102, 102, 102);
    self.tipsLab.font = [UIFont systemFontOfSize:16];
    [self addSubview:self.tipsLab];
    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.imv.mas_bottom).offset(30);
    }];
    
    self.reloginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.reloginBtn setTitle:@"重新登录" forState:(UIControlStateNormal)];
    [self.reloginBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    self.reloginBtn.layer.cornerRadius = 22;
    self.reloginBtn.backgroundColor = ETColorWithRGB(91, 113, 255);
    [self addSubview:self.reloginBtn];
    CGFloat leftOffset = ETScreenW * 0.18;
    CGFloat bottomOffet = ETScreenH *0.23;
    [self.reloginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(leftOffset);
        make.right.mas_equalTo(-leftOffset);
        make.height.mas_equalTo(44);
        make.bottom.mas_equalTo(-bottomOffet);
    }];
    
}

@end
